﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link rel="shortcut icon" href="image/favicons.ico" type="image/x-icon" />
<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
<link rel="stylesheet"
	href="<%=basePath%>common/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
<script charset="utf-8"
	src="<%=basePath%>common/plugins/code/prettify.js"></script>
<style type="text/css">
.input {
	width: 80px;
	height: 20px;
	line-height: 20px;
	background: white;
	text-align: center;
	display: inline-block;
	overflow: hidden;
	position: relative;
	text-decoration: none;
	top: 5px;
}

.input:hover {
	background: #ff8800;
}

.file {
	opacity: 0;
	filter: alpha(opacity =       0);
	font-size: 50px;
	position: absolute;
	top: 0;
	right: 0;
}

a:link {
	text-decoration: none;
}

a:visited {
	text-decoration: none;
}

a:hover {
	color: #999999;
	text-decoration: underline;
}
</style>
<!-- Main content -->
<section class="content" id="refundcontent">
<div class="row">
	<div class="col-md-12">

		<div class="box box-danger">
			<div class="box-header">

				<section class="content-header">
				<h1>
					<ol class="breadcrumb">
						<li>
							<a href="<%=basePath%>admin/xiazai"><i
								class="fa fa-th-list fa-lg"></i>列表</a>
						</li>
						<li>
							添加文件
						</li>
					</ol>
				</h1>


				</section>
			</div>
			<div class="box-body">
				<!-- phone mask -->
				<div class="form-group">

					<div class="bg-info" style="padding: 10px;">
						<p>
							<form action="upload" name="example" accept-charset="UTF-8"onsubmit="document.charset='utf-8';"
								enctype="multipart/form-data" method="post">
								 标题：<input  style="margin-right:80px;" type="text" name="title" value="" /> 
							 	<input type="hidden" name="time" value="" id="datetimepicker"><br><br>
								<div>
								文件：<input style="margin-right:80px;" type="text" readonly="readonly" name="name"/>
									<a href="javascript:void(0);" class="input"> 浏览 
									<input type="file" class="file" name="filename1"> </a>
								</div><br/><br/>
								<input class="btn  btn-info btn-xs info" type="submit" value="上传" style="width:100px;">
								<a  href="xiazai" class="btn  btn-info btn-xs info" style="width:100px;">返回</a>
							</form>
							<br />
							
							<script type="text/javascript">
        var nodes = document.getElementsByTagName("input");
        for ( var i = 0; i < nodes.length; i++) {
            if("file" == nodes[i].type){
                nodes[i].onchange = function(){
                    var textObj = this.parentNode.parentNode.getElementsByTagName("input")[0];
                    var textvalue = this.value;
                    textvalue = textvalue.substring(textvalue.lastIndexOf("\\")+1, textvalue.length);
                    textObj.value = textvalue;
                };
            }
        }
    </script>
							
						</p>
					</div>
					<div class="form-group">

					</div>
					<!-- /.form group -->

				</div>
				<!-- /.form group -->

			</div>
			<!-- /.box-body -->
		</div>
		<!-- /.box -->

	</div>
	<!-- /.col (left) -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->

<script type="text/javascript">
     		  
		$("#fileupload_input").fileupload({
		    url:"<%=basePath%>admin/uploadImg",
		    done:function(e,result){
					
		          $("#img").attr("src",result.result.entity);
		          $("#picurl").val(result.result.entity);
		      
		    }
		});
     </script>
